from django.db import models
from goodsapp.models import Goods
from shop_admin.models import MyUser
# Create your models here.


class Cart(models.Model):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=200)
    image_url = models.CharField(max_length=250)
    price = models.FloatField(null=True)
    number = models.IntegerField(default=0)
    goods_id = models.ForeignKey(Goods,on_delete=models.CASCADE,null=True)
    user_id = models.ForeignKey(MyUser,on_delete=models.CASCADE,null=True)


class fenye(models.Model):
    name = models.CharField(max_length=200)
    phone = models.CharField(max_length=200)
    age = models.CharField(max_length=200)


class Books(models.Model):
    name = models.CharField(max_length=200)
    read = models.IntegerField(default=2000)
    commit = models.CharField(max_length=150)
    time = models.CharField(max_length=200)


class Fenlei(models.Model):
    name = models.CharField(max_length=200)


class Shangpin(models.Model):
    name = models.CharField(max_length=150)
    pic = models.CharField(max_length=200)
    price = models.CharField(max_length=200)